home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Python 1.4 / Python 1.4 source / Lib / stdwin / filewin.py < prev    next >
Encoding:
Text File  |  1996-03-18  |  400 b   |  21 lines  |  [TEXT/Pyth]

  1. # Module 'filewin'
  2. # File windows, a subclass of textwin (which is a subclass of gwin)
  3.  
  4. import textwin
  5. import __builtin__
  6.  
  7.  
  8. # FILE WINDOW
  9.  
  10. def open_readonly(fn): # Open a file window
  11.     fp = __builtin__.open(fn, 'r')
  12.     w = textwin.open_readonly(fn, fp.read())
  13.     w.fn = fn
  14.     return w
  15.  
  16. def open(fn): # Open a file window
  17.     fp = __builtin__.open(fn, 'r')
  18.     w = textwin.open(fn, fp.read())
  19.     w.fn = fn
  20.     return w
  21.